/*
   JM From Tha Streetz
   Made by ups2000ups
*/

void npc(Player @player, NPC @npc) {
	int state = npc.getState();
	int type = npc.getSelected();
	npc.setVariable("type", type);
	string [] menu 		= {"Make a Claw", "Make a Glove", "Upgrade a Claw", "Upgrade a Glove", "Create material"};
	int [] _temp				= {0,0,0,0,0,0,0,0};
	int [] _tempinfo			= {0,0,0,0,0,0,0,0};

	// material
	int [] _ProcessedWood_v1 	= {4003001, 4000003};
	int [] _ProcessedWood_v1info 	= {1      , 10};

	int [] _ProcessedWood_v2 	= {4003001, 4000018};
	int [] _ProcessedWood_v2info 	= {1      , 5};
	
	int [] _Screws			= {4003000, 4011001, 4011000};
	int [] _Screwsinfo		= {15     , 1      , 1};


	//Make claw
	int [] makeclaw		= {7, 1472001, 1472004, 1472008, 1472011, 1472014, 1472018};
	string [] makeclawinfo	= {"empty", "(level limit : 15, thief)", "(level limit : 20, thief)", "(level limit : 30, thief)", "(level limit : 35, thief)", "(level limit : 40, thief)", "(level limit : 50, thief)"};

	int [] _SteelTitans			= {6, 4011001, 4000021, 4003000, 2000, 1472001};
	int [] _SteelTitansinfo			= {0, 1      , 20     , 5      , 0   , 999};
	int [] _BronzeIgor			= {7, 4011000, 4011001, 4000021, 4003000, 3000, 1472004};
	int [] _BronzeIgorinfo			= {0, 2      , 1      , 30     , 10     , 0   , 999};
	int [] _SteelGuards			= {7, 4011000, 4011001, 4000021, 4003000, 15000, 1472008};
	int [] _SteelGuardsinfo			= {0, 3      , 2      , 50     , 20     , 0   , 999};
	int [] _BronzeGuardian			= {7, 4011000, 4011001, 4000021, 4003000, 30000, 1472011};
	int [] _BronzeGuardianinfo		= {0, 4      , 3      , 80     , 25     , 0   , 999};
	int [] _SteelAvarice			= {7, 4011000, 4011001, 4000021, 4003000, 40000, 1472014};
	int [] _SteelAvariceinfo		= {0, 3      , 4      , 100    , 30     , 0   , 999};
	int [] _SteelSlain			= {7, 4011000, 4011001, 4000030, 4003000, 50000, 1472018};
	int [] _SteelSlaininfo			= {0, 4      , 5      , 40     , 35     , 0   , 999};

	//Make Glove
	int [] makeglove		= {12, 1082002, 1082029, 1082030, 1082031, 1082032, 1082037, 1082042, 1082046, 1082075, 1082065, 1082092};
	string [] makegloveinfo	 	= {"empty", "(level limit : 10, all)", "(level limit : 15, thief)", "(level limit : 15, thief)", "(level limit : 15, thief)", "(level limit : 20, thief)", "(level limit : 25, thief)", "(level limit : 40, thief)", "(level limit : 35, thief)", "(level limit : 40, thief)", "(level limit : 50, thief)", "(level limit : 60, thief)"};

	int [] _WorkGloves			= {4, 4000021, 1000, 1082002};
	int [] _WorkGlovesinfo			= {0, 15     , 0   , 999};
	int [] _BrownDuo			= {5, 4000021, 4000018, 7000, 1082029};
	int [] _BrownDuoinfo			= {0, 30     , 20     , 0   , 999};
	int [] _BlueDuo				= {5, 4000021, 4000015, 7000, 1082030};
	int [] _BlueDuoinfo			= {0, 30     , 20     , 0   , 999};
	int [] _BlackDuo			= {5, 4000021, 4000020, 7000, 1082031};
	int [] _BlackDuoinfo			= {0, 30     , 20      , 0   , 999};
	int [] _BronzeMischief			= {5, 4011000, 4000021, 10000, 1082032};
	int [] _BronzeMischiefinfo		= {0, 2      , 40     , 0    , 999};
	int [] _BronzeWolfskin			= {6, 4011000, 4011001, 4000021, 15000, 1082037};
	int [] _BronzeWolfskininfo		= {0, 2      , 1      , 10     , 0    , 999};
	int [] _SteelSylvia			= {6, 4011001, 4000021, 4003000, 25000, 1082042};
	int [] _SteelSylviainfo			= {0, 2      , 50     , 10     , 0    , 999};
	int [] _SteelArbion			= {7, 4011001, 4011000, 4000021, 4003000, 30000, 1082046};
	int [] _SteelArbioninfo			= {0, 3      , 1      , 60     , 15     , 0    , 999};
	int [] _RedCleave			= {7, 4021000, 4000014, 4000021, 4003000, 40000, 1082075};
	int [] _RedCleaveinfo			= {0, 3      , 200    , 80     , 30     , 0    , 999};
	int [] _BlueMoonGloves			= {7, 4021005, 4021008, 4000030, 4003000, 50000, 1082065};
	int [] _BlueMoonGlovesinfo		= {0, 3      , 1      , 40     , 30     , 0    , 999};
	int [] _BronzePow			= {8, 4011007, 4011000, 4021007, 4000030, 4003000, 70000, 1082092};
	int [] _BronzePowinfo			= {0, 1      , 8      , 1      , 50     , 50     , 0    , 999};


	//Upgrade Claw
	int [] upclaw		= {15, 1472002, 1472003, 1472005, 1472006, 1472007, 1472009, 1472010, 1472012, 1472013, 1472015, 1472016, 1472017, 1472019, 1472020};
	string [] upclawinfo	= {"empty", "(level limit : 15, thief)", "(level limit : 15, thief)", "(level limit : 20, thief)", "(level limit : 20, thief)", "(level limit : 25, thief)", "(level limit : 30, thief)", "(level limit : 30, thief)", "(level limit : 35, thief)", "(level limit : 35, thief)", "(level limit : 40, thief)", "(level limit : 40, thief)", "(level limit : 40, thief)", "(level limit : 50, thief)", "(level limit : 50, thief)"};

	int [] _MithrilTitans		= {5,1472001,4011002,1000, 1472002};
	int [] _MithrilTitansinfo	= {0,1      ,1      ,0   , 999};
	int [] _GoldTitans		= {5,1472001,4011006,2000, 1472003};
	int [] _GoldTitansinfo		= {0,1      ,1      ,0   , 999};
	int [] _SteelIgor		= {5,1472004,4011001,3000, 1472005};
	int [] _SteelIgorinfo		= {0,1      ,2      ,0   , 999};
	int [] _AdamantiumIgor		= {5,1472004,4011003,5000, 1472006};
	int [] _AdamantiumIgorinfo	= {0,1      ,2      ,0   , 999};
	int [] _Meba			= {7,1472000,4011001,4000021,4003001,5000, 1472007};
	int [] _Mebainfo		= {0,1      ,3      ,20     ,30     ,0   , 999};
	int [] _MithrilGuards		= {5,1472008,4011002,10000, 1472009};
	int [] _MithrilGuardsinfo	= {0,1      ,3      ,0    , 999};
	int [] _AdamantiumGuards	= {5,1472008,4011003,15000, 1472010};
	int [] _AdamantiumGuardsinfo	= {0,1      ,3      ,0    , 999};
	int [] _SilverGuardian		= {5,1472011,4011004,20000, 1472012};
	int [] _SilverGuardianinfo	= {0,1      ,4      ,0    , 999};
	int [] _DarkGuardian		= {5,1472011,4021008,25000, 1472013};
	int [] _DarkGuardianinfo	= {0,1      ,1      ,0    , 999};
	int [] _BloodAvarice		= {5,1472014,4021000,30000, 1472015};
	int [] _BloodAvariceinfo	= {0,1      ,5      ,0    , 999};
	int [] _AdamantiumAvarice	= {5,1472014,4011003,30000, 1472016};
	int [] _AdamantiumAvariceinfo	= {0,1      ,5      ,0    , 999};
	int [] _DarkAvarice		= {5,1472014,4021008,35000, 1472017};
	int [] _DarkAvariceinfo		= {0,1      ,2      ,0    , 999};
	int [] _BloodSlain		= {5,1472018,4021000,40000, 1472019};
	int [] _BloodSlaininfo		= {0,1      ,6      ,0    , 999};
	int [] _SapphireSlain		= {5,1472018,4021005,40000, 1472020};
	int [] _SapphireSlaininfo	= {0,1      ,6      ,0    , 999};


	//Upgrade glove
	int [] upGlove		= {15, 1082033, 1082034, 1082038, 1082039, 1082043, 1082044, 1082047, 1082045, 1082076, 1082074, 1082067, 1082066, 1082093, 1082094};
	string [] upGloveinfo	= {"empty", "(level limit : 20, thief)", "(level limit : 20, thief)", "(level limit : 25, thief)", "(level limit : 25, thief)", "(level limit : 30, thief)", "(level limit : 30, thief)", "(level limit : 35, thief)", "(level limit : 35, thief)", "(level limit : 40, thief)", "(level limit : 40, thief)", "(level limit : 50, thief)", "(level limit : 50, thief)", "(level limit : 60, thief)", "(level limit : 60, thief)"}; 

	int [] _MithrilMischief 		= {5,1082032,4011002,5000   ,1082033};
	int [] _MithrilMischiefinfo 		= {0,1      ,1      ,0      ,999};
	int [] _DarkMischief 			= {5,1082032,4021004,7000   ,1082034};
	int [] _DarkMischiefinfo 		= {0,1      ,1      ,0      ,999};
	int [] _MithrilWolfskin 		= {5,1082037,4011002,10000  ,1082038};
	int [] _MithrilWolfskininfo 		= {0,1      ,2      ,0      ,999};
	int [] _DarkWolfskin 			= {5,1082037,4021004,12000  ,1082039};
	int [] _DarkWolfskininfo 		= {0,1      ,2      ,0      ,999};
	int [] _SilverSylvia 			= {5,1082042,4011004,15000  ,1082043};
	int [] _SilverSylviainfo 		= {0,1      ,2      ,0      ,999};
	int [] _GoldSylvia 			= {5,1082042,4011006,20000  ,1082044};
	int [] _GoldSylviainfo 			= {0,1      ,1      ,0      ,999};
	int [] _OrihalconArbion 		= {5,1082046,4011005,22000  ,1082047};
	int [] _OrihalconArbioninfo 		= {0,1      ,3      ,0      ,999};
	int [] _GoldArbion 			= {5,1082046,4011006,25000  ,1082045};
	int [] _GoldArbioninfo 			= {0,1      ,2      ,0      ,999};
	int [] _GoldCleave 			= {5,1082075,4011006,45000  ,1082076};
	int [] _GoldCleaveinfo 			= {0,1      ,4      ,0      ,999};
	int [] _DarkCleave 			= {5,1082075,4021008,50000  ,1082074};
	int [] _DarkCleaveinfo 			= {0,1      ,2      ,0      ,999};
	int [] _RedMoonGloves 			= {5,1082065,4021000,55000  ,1082067};
	int [] _RedMoonGlovesinfo 		= {0,1      ,5      ,0      ,999};
	int [] _BrownMoonGloves 		= {6,1082065,4011006,4021008,60000  ,1082066};
	int [] _BrownMoonGlovesinfo 		= {0,1      ,2      ,1      ,0      ,999};
	int [] _StealPow 			= {5,1082092,4011001,4000014,70000  ,1082093};
	int [] _StealPowinfo 			= {0,1      ,7      ,200    ,0      ,999};
	int [] _GoldPow 			= {5,1082092,4011006,4000027,80000,1082094};
	int [] _GoldPowinfo 			= {0,1      ,7      ,150    ,0      ,999};




	if(state == 0){
		npc.addText("Do you have a mineral or a Leather by any chance? With a fee, I can make you an equipment perfect for a #bThief#k. Oh and don't tell anyone else about me doing some business here in this town... So, you want to do it?");
		npc.sendYesNo();
	}


	else if(state == 1){
		if(npc.getSelected() == YES){
			npc.addText("Alright! The fee will be reasonable so don't worry about it. What do you want to do? #b\r\n#L0#" + menu[0] + "#l\r\n#L1#" + menu[1] + "#l\r\n#L2#" + menu[2] + "#l\r\n#L3#" + menu[3] + "#l\r\n#L4#" + menu[4] + "#l#k");
			npc.sendSimple();
		}

		else if(npc.getSelected() == NO){
			npc.addText("Really? You won't regret a thing if you let me do it... if you ever change your mind, find me and we'll some business...");
			npc.sendNext();
			npc.end();
		}
	}


	else if(state == 2){
		if(type == 0){
			npc.addText("The claw is the glove you use to throw throwing-stars, which one do you want to make?");
			for(int x = 1; x < makeclaw[0]; x++){
				npc.addText("#b\r\n#L" + (x-1) + "##t" + makeclaw[x] + "##k " + makeclawinfo[x] + "#l");
			}
			npc.setState(9);
			npc.sendSimple();
		}
		else if(type == 1){
			npc.addText("Now... what kind of glove would you like to make?");
			for(int x = 1; x < makeglove[0]; x++){
				npc.addText("#b\r\n#L" + (x-1) + "##t" + makeglove[x] + "##k " + makegloveinfo[x] + "#l");
			}
			npc.setState(19);
			npc.sendSimple();
		}
		else if(type== 2){
			npc.addText("So you want to upgrade the claw? Ok, then. A word of warning, though: All the items that will be used for upgrading will be gone, but if you use an item that has been #rupgraded#k with a scroll, the effect will disappear when upgraded. Please take that into consideration when making the decision, ok?");
			npc.setState(29);
			npc.sendNext();
		}
		else if(type== 3){
			npc.addText("So you want to upgrade the glove? Ok, then. A word of warning, though: All the items that will be used for upgrading will be gone, but if you use an item that has been #rupgraded#k with a scroll, the effect will disappear when upgraded. Please take that into consideration when making the decision, ok?");
			npc.setState(39);
			npc.sendNext();
		}
		else if(type== 4){
			npc.addText("So you want to make some materials, huh? Okay... what kind of material do you want to make? #b\r\n#L0#Make #t" + _ProcessedWood_v1[0] + "# with #t" + _ProcessedWood_v1[1] + "##l\r\n#L1#Make #t" + _ProcessedWood_v2[0] + "# with #t" + _ProcessedWood_v2[1] + "##l\r\n#L2#Make #t" + _Screws[0] + "##l#k");
			npc.sendSimple();
		}
	}

// ---------------------------------------------- Upgrade glove
	else if(state == 40){
		npc.addText("So ~~ What kind of a glove do you want to upgrade and create?");
		for(int x = 1; x < upGlove[0]; x++){
			npc.addText("#b\r\n#L" + (x-1) + "##t" + upGlove[x] + "##k " + upGloveinfo[x] + "#l");
		}
		npc.sendSimple();
	}
	else if(state == 41){
		npc.setGetSaveInt(type);

		if(npc.getSaveInt() == 0){
			_temp = _MithrilMischief;
			_tempinfo = _MithrilMischiefinfo;
		}
		else if(npc.getSaveInt() == 1){
			_temp = _DarkMischief;
			_tempinfo = _DarkMischiefinfo;
		}
		else if(npc.getSaveInt() == 2){
			_temp = _MithrilWolfskin;
			_tempinfo = _MithrilWolfskininfo;
		}
		else if(npc.getSaveInt() == 3){
			_temp = _DarkWolfskin;
			_tempinfo = _DarkWolfskininfo;
		}
		else if(npc.getSaveInt() == 4){
			_temp = _SilverSylvia;
			_tempinfo = _SilverSylviainfo;
		}
		else if(npc.getSaveInt() == 5){
			_temp = _GoldSylvia;
			_tempinfo = _GoldSylviainfo;
		}
		else if(npc.getSaveInt() == 6){
			_temp = _OrihalconArbion;
			_tempinfo = _OrihalconArbioninfo;
		}
		else if(npc.getSaveInt() == 7){
			_temp = _GoldArbion;
			_tempinfo = _GoldArbioninfo;
		}
		else if(npc.getSaveInt() == 8){
			_temp = _GoldCleave;
			_tempinfo = _GoldCleaveinfo;
		}
		else if(npc.getSaveInt() == 9){
			_temp = _DarkCleave;
			_tempinfo = _DarkCleaveinfo;
		}
		else if(npc.getSaveInt() == 10){
			_temp = _RedMoonGloves;
			_tempinfo = _RedMoonGlovesinfo;
		}
		else if(npc.getSaveInt() == 12){
			_temp = _BrownMoonGloves;
			_tempinfo = _BrownMoonGlovesinfo;
		}
		else if(npc.getSaveInt() == 13){
			_temp = _StealPow;
			_tempinfo = _StealPowinfo;
		}
		else if(npc.getSaveInt() == 14){
			_temp = _GoldPow;
			_tempinfo = _GoldPowinfo;
		}


		npc.addText("To make one #t" +  _temp[_temp[0]-1] + "#, I need the following items. " + upGlove[npc.getSaveInt()+1] + " and please make sure you don't use an item that's been upgraded as a material for it. What do you think? Do you want one?");


		for(int i = 1; i < _temp[0]; i++){
			if(_tempinfo[i] == 0){
				npc.addText("#b\r\n#v4031138# " + _temp[i] + " Mesos #k");
			}
			else if(_tempinfo[i] == 999){
				// nothing right now just to not show is as payment
			}
			else if(_tempinfo[i] > 1){
				npc.addText("#b\r\n#v" + _temp[i] + "# " + + _tempinfo[i] + " #t" + _temp[i] + "##k");
			}
			else {
				npc.addText("#b\r\n#v" + _temp[i] + "#  #t" + _temp[i] + "##k");
			}
		} 
		npc.sendYesNo();
	}

	else if(state == 42){

		if(npc.getSaveInt() == 0){
			_temp = _MithrilMischief;
			_tempinfo = _MithrilMischiefinfo;
		}
		else if(npc.getSaveInt() == 1){
			_temp = _DarkMischief;
			_tempinfo = _DarkMischiefinfo;
		}
		else if(npc.getSaveInt() == 2){
			_temp = _MithrilWolfskin;
			_tempinfo = _MithrilWolfskininfo;
		}
		else if(npc.getSaveInt() == 3){
			_temp = _DarkWolfskin;
			_tempinfo = _DarkWolfskininfo;
		}
		else if(npc.getSaveInt() == 4){
			_temp = _SilverSylvia;
			_tempinfo = _SilverSylviainfo;
		}
		else if(npc.getSaveInt() == 5){
			_temp = _GoldSylvia;
			_tempinfo = _GoldSylviainfo;
		}
		else if(npc.getSaveInt() == 6){
			_temp = _OrihalconArbion;
			_tempinfo = _OrihalconArbioninfo;
		}
		else if(npc.getSaveInt() == 7){
			_temp = _GoldArbion;
			_tempinfo = _GoldArbioninfo;
		}
		else if(npc.getSaveInt() == 8){
			_temp = _GoldCleave;
			_tempinfo = _GoldCleaveinfo;
		}
		else if(npc.getSaveInt() == 9){
			_temp = _DarkCleave;
			_tempinfo = _DarkCleaveinfo;
		}
		else if(npc.getSaveInt() == 10){
			_temp = _RedMoonGloves;
			_tempinfo = _RedMoonGlovesinfo;
		}
		else if(npc.getSaveInt() == 12){
			_temp = _BrownMoonGloves;
			_tempinfo = _BrownMoonGlovesinfo;
		}
		else if(npc.getSaveInt() == 13){
			_temp = _StealPow;
			_tempinfo = _StealPowinfo;
		}
		else if(npc.getSaveInt() == 14){
			_temp = _GoldPow;
			_tempinfo = _GoldPowinfo;
		}


		if(npc.getSelected() == YES){

			type = 0;

			for(int x = 1; x < _temp[0]; x++){

				if(_tempinfo[x] == 0){
					if(player.getMesos() < _temp[x]){
						type = 1;
					}
				}
				else if(_tempinfo[x] == 999){
					// nothing just to skip it for now
				}
				else {
					if(player.getItemAmount(_temp[x]) < _tempinfo[x]){
						type = 1;
					}
				}
			}

			if(type == 0){
				for(int x = 1; x < _temp[0]; x++){

					if(_tempinfo[x] == 0){
						player.giveMesos(-_temp[x]);
					}
					else if(_tempinfo[x] == 999){
						player.giveItem(_temp[x], 1);
					}
					else {
						player.giveItem(_temp[x], -_tempinfo[x]);
					}
				}

				npc.addText("Did it turn out OK? Well it looks like it did! Come back if you want to upgrade something else.");
				npc.sendNext();
				npc.end();
			}
			else if (type == 1){
				npc.addText("Check and see if you have everything you need and if your equipment inventory may be full or not.");
				npc.sendNext();
				npc.end();
			}

		}
		else if(npc.getSelected() == NO){
			npc.addText("Lacking the materials? It's OK... Collect them all and then come find me, alright? I'll be waiting...");
			npc.sendNext();
			npc.end();
		}
	}


// ---------------------------------------------- Upgrade Claw
	else if(state == 30){
		npc.addText("So ~~ what kind of a claw do you want to upgrade and creat?");
		for(int x = 1; x < upclaw[0]; x++){
			npc.addText("#b\r\n#L" + (x-1) + "##t" + upclaw[x] + "##k " + upclawinfo[x] + "#l");
		}
		npc.sendSimple();
	}
	else if(state == 31){
		npc.setGetSaveInt(type);

		if(npc.getSaveInt() == 0){
			_temp = _MithrilTitans;
			_tempinfo = _MithrilTitansinfo;
		}
		else if(npc.getSaveInt() == 1){
			_temp = _GoldTitans;
			_tempinfo = _GoldTitansinfo;
		}
		else if(npc.getSaveInt() == 2){
			_temp = _SteelIgor;
			_tempinfo = _SteelIgorinfo;
		}
		else if(npc.getSaveInt() == 3){
			_temp = _AdamantiumIgor;
			_tempinfo = _AdamantiumIgorinfo;
		}
		else if(npc.getSaveInt() == 4){
			_temp = _Meba;
			_tempinfo = _Mebainfo;
		}
		else if(npc.getSaveInt() == 5){
			_temp = _MithrilGuards;
			_tempinfo = _MithrilGuardsinfo;
		}
		else if(npc.getSaveInt() == 6){
			_temp = _AdamantiumGuards;
			_tempinfo = _AdamantiumGuardsinfo;
		}
		else if(npc.getSaveInt() == 7){
			_temp = _SilverGuardian;
			_tempinfo = _SilverGuardianinfo;
		}
		else if(npc.getSaveInt() == 8){
			_temp = _DarkGuardian;
			_tempinfo = _DarkGuardianinfo;
		}
		else if(npc.getSaveInt() == 9){
			_temp = _BloodAvarice;
			_tempinfo = _BloodAvariceinfo;
		}
		else if(npc.getSaveInt() == 10){
			_temp = _AdamantiumAvarice;
			_tempinfo = _AdamantiumAvariceinfo;
		}
		else if(npc.getSaveInt() == 12){
			_temp = _DarkAvarice;
			_tempinfo =_DarkAvariceinfo;
		}
		else if(npc.getSaveInt() == 13){
			_temp = _BloodSlain;
			_tempinfo = _BloodSlaininfo;
		}
		else if(npc.getSaveInt() == 14){
			_temp = _SapphireSlain;
			_tempinfo = _SapphireSlaininfo;
		}


		npc.addText("To make one #t" +  _temp[_temp[0]-1] + "#, I need the following items. " + upclaw[npc.getSaveInt()+1] + " and please make sure you don't use an item that's been upgraded as a material for it. What do you think? Do you want one?");


		for(int i = 1; i < _temp[0]; i++){
			if(_tempinfo[i] == 0){
				npc.addText("#b\r\n#v4031138# " + _temp[i] + " Mesos #k");
			}
			else if(_tempinfo[i] == 999){
				// nothing right now just to not show is as payment
			}
			else if(_tempinfo[i] > 1){
				npc.addText("#b\r\n#v" + _temp[i] + "# " + + _tempinfo[i] + " #t" + _temp[i] + "##k");
			}
			else {
				npc.addText("#b\r\n#v" + _temp[i] + "#  #t" + _temp[i] + "##k");
			}
		} 
		npc.sendYesNo();
	}

	else if(state == 32){

		if(npc.getSaveInt() == 0){
			_temp = _MithrilTitans;
			_tempinfo = _MithrilTitansinfo;
		}
		else if(npc.getSaveInt() == 1){
			_temp = _GoldTitans;
			_tempinfo = _GoldTitansinfo;
		}
		else if(npc.getSaveInt() == 2){
			_temp = _SteelIgor;
			_tempinfo = _SteelIgorinfo;
		}
		else if(npc.getSaveInt() == 3){
			_temp = _AdamantiumIgor;
			_tempinfo = _AdamantiumIgorinfo;
		}
		else if(npc.getSaveInt() == 4){
			_temp = _Meba;
			_tempinfo = _Mebainfo;
		}
		else if(npc.getSaveInt() == 5){
			_temp = _MithrilGuards;
			_tempinfo = _MithrilGuardsinfo;
		}
		else if(npc.getSaveInt() == 6){
			_temp = _AdamantiumGuards;
			_tempinfo = _AdamantiumGuardsinfo;
		}
		else if(npc.getSaveInt() == 7){
			_temp = _SilverGuardian;
			_tempinfo = _SilverGuardianinfo;
		}
		else if(npc.getSaveInt() == 8){
			_temp = _DarkGuardian;
			_tempinfo = _DarkGuardianinfo;
		}
		else if(npc.getSaveInt() == 9){
			_temp = _BloodAvarice;
			_tempinfo = _BloodAvariceinfo;
		}
		else if(npc.getSaveInt() == 10){
			_temp = _AdamantiumAvarice;
			_tempinfo = _AdamantiumAvariceinfo;
		}
		else if(npc.getSaveInt() == 12){
			_temp = _DarkAvarice;
			_tempinfo =_DarkAvariceinfo;
		}
		else if(npc.getSaveInt() == 13){
			_temp = _BloodSlain;
			_tempinfo = _BloodSlaininfo;
		}
		else if(npc.getSaveInt() == 14){
			_temp = _SapphireSlain;
			_tempinfo = _SapphireSlaininfo;
		}


		if(npc.getSelected() == YES){

			type = 0;

			for(int x = 1; x < _temp[0]; x++){

				if(_tempinfo[x] == 0){
					if(player.getMesos() < _temp[x]){
						type = 1;
					}
				}
				else if(_tempinfo[x] == 999){
					// nothing just to skip it for now
				}
				else {
					if(player.getItemAmount(_temp[x]) < _tempinfo[x]){
						type = 1;
					}
				}
			}

			if(type == 0){
				for(int x = 1; x < _temp[0]; x++){

					if(_tempinfo[x] == 0){
						player.giveMesos(-_temp[x]);
					}
					else if(_tempinfo[x] == 999){
						player.giveItem(_temp[x], 1);
					}
					else {
						player.giveItem(_temp[x], -_tempinfo[x]);
					}
				}

				npc.addText("Did it turn out OK? Well it looks like it did! Come back if you want to upgrade something else.");
				npc.sendNext();
				npc.end();
			}
			else if (type == 1){
				npc.addText("Check and see if you have everything you need and if your equipment inventory may be full or not.");
				npc.sendNext();
				npc.end();
			}

		}
		else if(npc.getSelected() == NO){
			npc.addText("Lacking the materials? It's OK... Collect them all and then come find me, alright? I'll be waiting...");
			npc.sendNext();
			npc.end();
		}
	}



// ------------------------------------------- Make Glove
	else if(state == 20){
		npc.setGetSaveInt(type);

		if(npc.getSaveInt() == 0){
			_temp = _WorkGloves;
			_tempinfo = _WorkGlovesinfo;
		}
		else if(npc.getSaveInt() == 1){
			_temp = _BrownDuo;
			_tempinfo = _BrownDuoinfo;
		}
		else if(npc.getSaveInt() == 2){
			_temp = _BlueDuo;
			_tempinfo = _BlueDuoinfo;
		}
		else if(npc.getSaveInt() == 3){
			_temp = _BlackDuo;
			_tempinfo = _BlackDuoinfo;
		}
		else if(npc.getSaveInt() == 4){
			_temp = _BronzeMischief;
			_tempinfo = _BronzeMischiefinfo;
		}
		else if(npc.getSaveInt() == 5){
			_temp = _BronzeWolfskin;
			_tempinfo = _BronzeWolfskininfo;
		}
		else if(npc.getSaveInt() == 6){
			_temp = _SteelSylvia;
			_tempinfo = _SteelSylviainfo;
		}
		else if(npc.getSaveInt() == 7){
			_temp = _SteelArbion;
			_tempinfo = _SteelArbioninfo;
		}
		else if(npc.getSaveInt() == 8){
			_temp = _RedCleave;
			_tempinfo = _RedCleaveinfo;
		}
		else if(npc.getSaveInt() == 9){
			_temp = _BlueMoonGloves;
			_tempinfo = _BlueMoonGlovesinfo;
		}
		else if(npc.getSaveInt() == 10){
			_temp = _BronzePow;
			_tempinfo = _BronzePowinfo;
		}

		npc.addText("To make one #t" +  _temp[_temp[0]-1] + "#, I need the following items. " + makegloveinfo[npc.getSaveInt()+1] + " and please make sure you don't use an item that's been upgraded as a material for it. What do you think? Do you want one?");


		for(int i = 1; i < _temp[0]; i++){
			if(_tempinfo[i] == 0){
				npc.addText("#b\r\n#v4031138# " + _temp[i] + " Mesos #k");
			}
			else if(_tempinfo[i] == 999){
				// nothing right now just to not show is as payment
			}
			else if(_tempinfo[i] > 1){
				npc.addText("#b\r\n#v" + _temp[i] + "# " + + _tempinfo[i] + " #t" + _temp[i] + "##k");
			}
			else {
				npc.addText("#b\r\n#v" + _temp[i] + "#  #t" + _temp[i] + "##k");
			}
		} 
		npc.sendYesNo();
	}

	else if(state == 21){

		if(npc.getSaveInt() == 0){
			_temp = _WorkGloves;
			_tempinfo = _WorkGlovesinfo;
		}
		else if(npc.getSaveInt() == 1){
			_temp = _BrownDuo;
			_tempinfo = _BrownDuoinfo;
		}
		else if(npc.getSaveInt() == 2){
			_temp = _BlueDuo;
			_tempinfo = _BlueDuoinfo;
		}
		else if(npc.getSaveInt() == 3){
			_temp = _BlackDuo;
			_tempinfo = _BlackDuoinfo;
		}
		else if(npc.getSaveInt() == 4){
			_temp = _BronzeMischief;
			_tempinfo = _BronzeMischiefinfo;
		}
		else if(npc.getSaveInt() == 5){
			_temp = _BronzeWolfskin;
			_tempinfo = _BronzeWolfskininfo;
		}
		else if(npc.getSaveInt() == 6){
			_temp = _SteelSylvia;
			_tempinfo = _SteelSylviainfo;
		}
		else if(npc.getSaveInt() == 7){
			_temp = _SteelArbion;
			_tempinfo = _SteelArbioninfo;
		}
		else if(npc.getSaveInt() == 8){
			_temp = _RedCleave;
			_tempinfo = _RedCleaveinfo;
		}
		else if(npc.getSaveInt() == 9){
			_temp = _BlueMoonGloves;
			_tempinfo = _BlueMoonGlovesinfo;
		}
		else if(npc.getSaveInt() == 10){
			_temp = _BronzePow;
			_tempinfo = _BronzePowinfo;
		}


		if(npc.getSelected() == YES){

			type = 0;

			for(int x = 1; x < _temp[0]; x++){

				if(_tempinfo[x] == 0){
					if(player.getMesos() < _temp[x]){
						type = 1;
					}
				}
				else if(_tempinfo[x] == 999){
					// nothing just to skip it for now
				}
				else {
					if(player.getItemAmount(_temp[x]) < _tempinfo[x]){
						type = 1;
					}
				}
			}

			if(type == 0){
				for(int x = 1; x < _temp[0]; x++){

					if(_tempinfo[x] == 0){
						player.giveMesos(-_temp[x]);
					}
					else if(_tempinfo[x] == 999){
						player.giveItem(_temp[x], 1);
					}
					else {
						player.giveItem(_temp[x], -_tempinfo[x]);
					}
				}

				npc.addText("Did it turn out OK? Well it looks like it did! Come back if you want to create something else.");
				npc.sendNext();
				npc.end();
			}
			else if (type == 1){
				npc.addText("Check and see if you have everything you need and if your equipment inventory may be full or not.");
				npc.sendNext();
				npc.end();
			}

		}
		else if(npc.getSelected() == NO){
			npc.addText("Lacking the materials? It's OK... Collect them all and then come find me, alright? I'll be waiting...");
			npc.sendNext();
			npc.end();
		}
	}

// ------------------------------------------- Make Claw
	else if(state == 10){
		npc.setGetSaveInt(type);

		if(npc.getSaveInt() == 0){
			_temp = _SteelTitans;
			_tempinfo = _SteelTitansinfo;
		}
		else if(npc.getSaveInt() == 1){
			_temp = _BronzeIgor;
			_tempinfo = _BronzeIgorinfo;
		}
		else if(npc.getSaveInt() == 2){
			_temp = _SteelGuards;
			_tempinfo = _SteelGuardsinfo;
		}
		else if(npc.getSaveInt() == 3){
			_temp = _BronzeGuardian;
			_tempinfo = _BronzeGuardianinfo;
		}
		else if(npc.getSaveInt() == 4){
			_temp = _SteelAvarice;
			_tempinfo = _SteelAvariceinfo;
		}
		else if(npc.getSaveInt() == 5){
			_temp = _SteelSlain;
			_tempinfo = _SteelSlaininfo;
		}

		npc.addText("To make one #t" +  _temp[_temp[0]-1] + "#, I need the following items. " + makeclawinfo[npc.getSaveInt()+1] + " and please make sure you don't use an item that's been upgraded as a material for it. What do you think? Do you want one?");


		for(int i = 1; i < _temp[0]; i++){
			if(_tempinfo[i] == 0){
				npc.addText("#b\r\n#v4031138# " + _temp[i] + " Mesos #k");
			}
			else if(_tempinfo[i] == 999){
				// nothing right now just to not show is as payment
			}
			else if(_tempinfo[i] > 1){
				npc.addText("#b\r\n#v" + _temp[i] + "# " + + _tempinfo[i] + " #t" + _temp[i] + "##k");
			}
			else {
				npc.addText("#b\r\n#v" + _temp[i] + "#  #t" + _temp[i] + "##k");
			}
		} 
		npc.sendYesNo();
	}

	else if(state == 11){

		if(npc.getSaveInt() == 0){
			_temp = _SteelTitans;
			_tempinfo = _SteelTitansinfo;
		}
		else if(npc.getSaveInt() == 1){
			_temp = _BronzeIgor;
			_tempinfo = _BronzeIgorinfo;
		}
		else if(npc.getSaveInt() == 2){
			_temp = _SteelGuards;
			_tempinfo = _SteelGuardsinfo;
		}
		else if(npc.getSaveInt() == 3){
			_temp = _BronzeGuardian;
			_tempinfo = _BronzeGuardianinfo;
		}
		else if(npc.getSaveInt() == 4){
			_temp = _SteelAvarice;
			_tempinfo = _SteelAvariceinfo;
		}
		else if(npc.getSaveInt() == 5){
			_temp = _SteelSlain;
			_tempinfo = _SteelSlaininfo;
		}


		if(npc.getSelected() == YES){

			type = 0;

			for(int x = 1; x < _temp[0]; x++){

				if(_tempinfo[x] == 0){
					if(player.getMesos() < _temp[x]){
						type = 1;
					}
				}
				else if(_tempinfo[x] == 999){
					// nothing just to skip it for now
				}
				else {
					if(player.getItemAmount(_temp[x]) < _tempinfo[x]){
						type = 1;
					}
				}
			}

			if(type == 0){
				for(int x = 1; x < _temp[0]; x++){

					if(_tempinfo[x] == 0){
						player.giveMesos(-_temp[x]);
					}
					else if(_tempinfo[x] == 999){
						player.giveItem(_temp[x], 1);
					}
					else {
						player.giveItem(_temp[x], -_tempinfo[x]);
					}
				}

				npc.addText("Did it turn out OK? Well it looks like it did! Come back if you want to create something else.");
				npc.sendNext();
				npc.end();
			}
			else if (type == 1){
				npc.addText("Check and see if you have everything you need and if your equipment inventory may be full or not.");
				npc.sendNext();
				npc.end();
			}

		}
		else if(npc.getSelected() == NO){
			npc.addText("Lacking the materials? It's OK... Collect them all and then come find me, alright? I'll be waiting...");
			npc.sendNext();
			npc.end();
		}
	}


// ------------------------------------------ Materials

	else if(state == 3){
		npc.setGetSaveInt(type);


		if(npc.getSaveInt() == 0){
			npc.addText("With #b10 #t" + _ProcessedWood_v1[1] + "##k, I can make 1 #t" + _ProcessedWood_v1[0] + "#(s). Be thankful, because this one's pn me- What do you think? How many do you want?");
			npc.sendGetNumber(0, 0, 100);
		}
		else if(npc.getSaveInt() == 1){
			npc.addText("With #b5 #t" + _ProcessedWood_v2[1] + "##k, I can make 1 #t" + _ProcessedWood_v2[0] + "#(s). Be thankful, because this one's pn me- What do you think? How many do you want?");
			npc.sendGetNumber(0, 0, 100);
		}
		else if(npc.getSaveInt() == 2){
			npc.addText("With #b1 #t" + _Screws[1] + "#(s) and #t" + _Screws[2] + "#(s) each #k, I can make 15 #t" + _Screws[0] + "#(s). Be thankful, because this one's pn me- What do you think? How many do you want?");
			npc.sendGetNumber(0, 0, 100);	
		}

	}
	else if(state == 4){

		if(npc.getSaveInt() == 0){
			npc.addText("You want to make #b#t" + _ProcessedWood_v1[0] + "#(s)#k " + npc.getNumber() + "time(s)? I'll need #r" + _ProcessedWood_v1info[1]*npc.getNumber() + " #t" + _ProcessedWood_v1[1] + "##k then.");
			npc.sendYesNo(); 
		}
		else if(npc.getSaveInt() == 1){
			npc.addText("You want to make #b#t" + _ProcessedWood_v2[0] + "#(s)#k " + npc.getNumber() + "time(s)? I'll need #r" + _ProcessedWood_v2info[1]*npc.getNumber() + " #t" + _ProcessedWood_v2[1] + "##k then.");
			npc.sendYesNo();
		}
		else if(npc.getSaveInt() == 2){
			npc.addText("You want to make #b#t" + _Screws[0] + "##k " + npc.getNumber() + "time(s)? I'll need #r" + _Screwsinfo[1]*npc.getNumber() + " #t" + _Screws[1] + "# and #t" + _Screws[2] + "#(s)#k then.");
			npc.sendYesNo();

		}

	}
	else if(state == 5){
		if(npc.getSelected() == YES){
			if(npc.getSaveInt() == 0){
				if(player.getItemAmount(_ProcessedWood_v1[1]) >= 10*npc.getNumber()){
					player.giveItem(_ProcessedWood_v1[1], -(10*npc.getNumber()));
					player.giveItem(_ProcessedWood_v1[0], 1*npc.getNumber());
					npc.addText("Here! take " + npc.getNumber() + " #t" + _ProcessedWood_v1[0] + "#(s). Don't you think I'm as good as Mr. Thunder? Your'll be more than satisfied with what I made here.");
					npc.sendNext();
					npc.end();
				}
				else {
					npc.addText("Check and see if you have everything you need and if your ETC inventory may be full or not.");
					npc.sendNext();
					npc.end();
				}
			}
			else if(npc.getSaveInt() == 1){
				if(player.getItemAmount(_ProcessedWood_v2[1]) >= 5*npc.getNumber()){
					player.giveItem(_ProcessedWood_v2[1], -(5*npc.getNumber()));
					player.giveItem(_ProcessedWood_v2[0], 1*npc.getNumber());
					npc.addText("Here! take " + npc.getNumber() + " #t" + _ProcessedWood_v2[0] + "#(s). don't you think i'm as good as Mr. Thunder? Your'll be more than satisfied with what I made here.");
					npc.sendNext();
					npc.end();
				}
				else {
					npc.addText("Check and see if you have everything you need and if your etc inventory may be full or not.");
					npc.sendNext();
				}
				
			}
			else if(npc.getSaveInt() == 2){
				if((player.getItemAmount(_Screws[1]) >= 1*npc.getNumber()) && (player.getItemAmount(_Screws[2]) >= 1*npc.getNumber())){
					player.giveItem(_Screws[2], -(1*npc.getNumber()));
					player.giveItem(_Screws[1], -(1*npc.getNumber()));
					player.giveItem(_Screws[0], 15*npc.getNumber());
					npc.addText("Here! take " + npc.getNumber() + " #t" + _Screws[0] + "#(s). don't you think i'm as good as Mr. Thunder? Your'll be more than satisfied with what I made here.");
					npc.sendNext();
					npc.end();
				}
				else {
					npc.addText("Check and see if you have everything you need and if your ETC inventory may be full or not.");
					npc.sendNext();
				}

			}
		}
		else if(npc.getSelected() == NO){
			npc.addText("Lacking the materials? It's all good... Collect them all and then come find me, alright? I'll be waiting...");
			npc.sendNext();
			npc.end();
		}

	} 
}
